// 此文件用于配置项和相关参数设置

//详情展示页
//基本信息 
//基础信息模块
const detailInfo = [{
        label: "备件名称",
        name: "productName",
        value: ""
    }, {
        label: "备件编号",
        name: "productNumber",
        value: ""
    }, {
        label: "规格型号",
        name: "productModel",
        value: ""
    }, {
        label: "类别",
        name: "productType",
        value: ""
    }, {
        label: "归属部门",
        name: "organName",
        value: ""
    }, {
        label: "通用/专用",
        name: "usageType",
        value: ""
    }, {
        label: "单价",
        name: "productPrice",
        value: ""
    }, {
        label: "设计/承接方",
        name: "designer",
        value: ""
    }, {
        label: "保存地点",
        name: "location",
        value: ""
    }, {
        label: "品牌",
        name: "brand",
        value: ""
    }, {
        label: "供应商",
        name: "supplier",
        value: ""
    }, {
        label: "库存报警下限",
        name: "bottomLimit",
        value: ""
    }, {
        label: "库存报警上限",
        name: "topLimit",
        value: ""
    }

]

const detailShowInfo = { title: '基础信息', content: detailInfo }
const checkDeviceShowInfo = {
    title: '关联设备',
    content: '',
    tableColumns: [
        { type: 'index', label: '序号', width: 140 },
        { prop: 'deviceName', label: '设备名称', minWidth: 180 },

        {
            prop: 'assetNumber',
            label: '设备编号',
            width: 100
                // render: (row) => {
                //   const { deviceInfo } = row;
                //   return deviceInfo.name ? deviceInfo.name :"";
                // },
        },
        { prop: 'organName', label: '使用部门', minWidth: 180 },
        { prop: 'deviceClass', label: '设备分类', minWidth: 180 }
    ],
    tableData: []
}
const checkOperateShowInfo = {
    title: '入库记录',
    content: '',
    tableColumns: [
        { type: 'index', label: '序号', width: 140 },
        {
            prop: 'createdTime',
            label: '入库时间',
            minWidth: 180,
            filter: 'formatDate'
        },

        {
            prop: "stockNum",
            label: "入库数量",
            width: 100,
            // render: (row) => {
            //   const { deviceInfo } = row;
            //   return deviceInfo.name ? deviceInfo.name :"";
            // },
        },
        {
            prop: "filePath",
            label: "入库单",
            width: 100,
            slotName: "operate-filePath"

        }
    ],
    tableData: []
}
const checkItemsShowInfo = {
        title: '出库记录',
        content: '',
        tableColumns: [
            { type: 'index', label: '序号', width: 140 },

            {
                prop: 'receiveMan',
                label: '领用人',
                width: 100
                    // render: (row) => {
                    //   const { deviceInfo } = row;
                    //   return deviceInfo.name ? deviceInfo.name :"";
                    // },
            },
            {
                prop: 'receiveReason',
                label: '领用原因',
                width: 100
            },
            { prop: 'stockNum', label: '出库数量', minWidth: 180 },
            {
                prop: 'createdTime',
                label: '出库时间',
                minWidth: 180,
                filter: 'formatDate'
            }
        ],
        tableData: []
    }
    // 档案展示信息
const histroyShowInfo = [{
            label: '文档资料(word)',

            children: [{
                label: '二级 1-1',
                imgSrc: 'https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png'
            }]
        },
        {
            label: '文档资料(pdf)',
            children: [{
                    label: '二级 2-1',
                    imgSrc: 'https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png'
                },
                {
                    label: '二级 2-2',
                    imgSrc: 'https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png'
                }
            ]
        },
        {
            label: '图像资料',
            children: [{
                    label: '二级 3-1',
                    imgSrc: 'https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png'
                },
                {
                    label: '二级 3-2',
                    imgSrc: 'https://panjiachen.gitee.io/vue-element-admin/static/img/404.a57b6f31.png'
                }
            ]
        }
    ]
    // 基础信息表单配置
const formData = {
        title: '基础信息',
        formModel: {
            productName: '1',
            productNumber: '1',
            productModel: '',
            productType: '',
            usageType: '2',
            productPrice: '1',
            topLimit: '',
            bottomLimit: '',
            location: '',
            designer: '',
            brand: '',
            supplier: '',
            organId: ''
        },
        formComponent: [{
                type: 'input',
                label: '备件名称',
                model: 'productName',
                keyUpEnter: 'handleFilter',
                rules: [{ required: true, message: '请输入计划名称', trigger: 'blur' }]
            },
            {
                // span: 18,
                type: 'input',
                label: '备件编号',
                model: 'productNumber',
                option: [{ label: '定期', value: '0' }, { label: '日常', value: '1' }],
                rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
            },
            {
                span: 5,
                type: 'input',
                label: '型号规格',
                model: 'productModel',
                // option: [1, 2, 3],
                rules: [{ required: true, message: '请输入型号规格', trigger: 'blur' }]
            },
            {
                // span: 8,
                type: 'select',
                label: '类别',
                model: 'productType',

                option: [{ label: '自制', value: 0 }, { label: '外购', value: 1 }],
                rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
            },
            {
                // span: 8,
                type: 'select',
                label: '通用/专用',
                model: 'usageType',

                option: [{ label: '通用', value: 0 }, { label: '专用', value: 1 }],
                rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
            },
            {
                // span: 11,
                type: 'select',
                label: '归属部门',
                model: 'organId',
                option: [1],
                rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
            },
            {
                //  span: 11,
                type: 'input',
                label: '库存报警下限',
                model: 'bottomLimit',
                // option: [{ value: "1", label: "周一" }, { value: "2", label: "周二" }, { value: "3", label: "周三" }, { value: "4", label: "周四" }, { value: "5", label: "周五" }],
                rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
            },
            {
                // span: 11,
                type: 'input',
                label: '库存报警上限',
                model: 'topLimit',
                // option: [{ value: "1", label: "周一" }, { value: "2", label: "周二" }, { value: "3", label: "周三" }, { value: "4", label: "周四" }, { value: "5", label: "周五" }],
                rules: [{ required: true, message: '请输入计划周期', trigger: 'blur' }]
            }
        ]
    }
    // 档案信息
const operateFormInfo = {
        title: '扩展信息',
        formModel: {
            productPrice: '',
            designer: '',
            location: '',
            brand: '',
            supplier: ''
        },
        formComponent: [{
                type: 'input',
                label: '单价',
                model: 'productPrice',
                // option: [{ label: "指定人员", value: "0" }, { label: "指定部门", value: "1" }],
                rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
            },
            {
                type: 'input',
                label: '设计/承制方',
                model: 'designer',
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
            },
            {
                type: 'input',
                label: '保存地点',
                model: 'location',
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
            },
            {
                type: 'input',
                label: '品牌',
                model: 'brand',
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
            },
            {
                type: 'input',
                label: '供应商',
                model: 'supplier',
                // option: [{ label: "张三", value: "0" }, { label: "李四", value: "1" }],
                rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
            }
        ]
    }
    // 备件档案
const operate1FormInfo = {
        title: '备件档案',
        formModel: {
            fileTitle: ''
        },
        formComponent: [{
            type: 'upload',
            model: 'archives',
            // option: [{ label: "指定人员", value: "0" }, { label: "指定部门", value: "1" }],
            rules: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
        }]
    }
    // 整理后的表单配置
const deviceForm0 = [{
    formName: '计划基础信息',
    formRef: 'table1', // 表单ref
    formModel: formData.formModel, // 表单model
    formComponent: formData.formComponent,
    formName: formData.title // 表单标题
}]
const operateForm0 = [{
    formName: '点检员',
    formRef: 'table2', // 表单ref
    formModel: operateFormInfo.formModel, // 表单model
    formComponent: operateFormInfo.formComponent,
    formName: operateFormInfo.title // 表单标题
}]
const operateForm1 = [{
    formName: '点检员',
    formRef: 'table2', // 表单ref
    formModel: operate1FormInfo.formModel, // 表单model
    formComponent: operate1FormInfo.formComponent,
    formName: operate1FormInfo.title // 表单标题
}]

const data = {
    basicForm0: deviceForm0,
    operateForm0: operateForm0,
    operateForm1: operateForm1,
    // ----------表单显示相关---------//
    // 计划基本信息
    detailShowInfo: detailShowInfo,
    histroyShowInfo: histroyShowInfo,
    // 点检设备
    checkDeviceShowInfo: checkDeviceShowInfo,
    // 点检员
    checkOperateShowInfo: checkOperateShowInfo,
    // 点检项
    checkItemsShowInfo: checkItemsShowInfo
}
export default data